<?php

// Textallion syntax for pmwiki
//
// Get the lastest version from http://www.pmwiki.org/wiki/Cookbook/Textallion
// or from the svn: http://txt2tags.googlecode.com/svn/trunk/extras/pmwiki/textallion.php
//
// Installation :
// - Save this textallion.php in your /cookbook directory.
// - Add the following line into your local/config.php script:
//   require_once ("cookbook/textallion.php"); 
//   


$RecipeInfo['textallion']['Version'] = '2012-12-01';


// textallion specifics:
// PmWiki allows some advanced formatting not in txt2tags. We can extend it using the textallion syntax (see http://code.google.com/p/textallion/)

	Markup ('textallion_center_zone_open' , '<fulltext', '/\{ ~~ \}/' , "<div style='text-align:center;'>");

	Markup ('textallion_center_zone_close' , '<fulltext', '/{\/~~ \}/' , "</div>");

	Markup ('textallion_center_zone' , 'directives', '/\{ ~~ \}(.*?)\{\/~~ \}/' , "%center% $1");
	
	Markup ('textallion_exergue_zone' , 'directives', '/\{  ~~\}(.*?)\{\/ ~~\}/' , "''%right% $1''");
	
	Markup ('textallion_rfloat' , '<directives', '/\{~~~~\}Attach:(.*?)/' , "%rfloat% Attach:$1");
	Markup ('textallion_lfloat' , 'directives', '/(.*?)\{~~~~\}/' , "%lfloat% $1");
	Markup ('textallion_linebreak' , '<directives', '/\{\/\/..\}/' , '<br/>');
	
	# french dialogs
	Markup ('txt2tags_french_dialog'    , 'directives', '/^--- (.*?)/', "&mdash; $1");	

	Markup ('txt2tags_french_dialog2'    , '<directives', '/ --- /', " &mdash; ");		

	# french guillemets
	Markup ('txt2tags_french_guillemets_open01'    , 'directives', '/\{ "  \}/', "&laquo;&nbsp;");
	Markup ('txt2tags_french_guillemets_open01'    , 'directives', '/\{"   \}/', "&laquo;&nbsp;");
	Markup ('txt2tags_french_guillemets_open01'    , 'directives', '/\{" \}/', "&laquo;&nbsp;");
	
	Markup ('txt2tags_french_guillemets_close01'    , 'directives', '/\{  " \}/', "&nbsp;&raquo;");
	Markup ('txt2tags_french_guillemets_close01'    , 'directives', '/\{   "\}/', "&nbsp;&raquo;");
	Markup ('txt2tags_french_guillemets_close01'    , 'directives', '/\{ "\}/', "&nbsp;&raquo;");
	# 


	# boxed area { [] }
	Markup ('txt2tags_boxed_area_open'    , '<fulltext', '/\{ \[\] \}/', "(:div style=\"font-style:regular;color:#504020; border:1px solid #504020;background-color:#F3F3F3;padding:5px;\":)");
	Markup ('txt2tags_boxed_area_close'    , '<fulltext', '/\{\/\[\] \}/', "(:divend:)");

	# italic area { // }
	Markup ('txt2tags_french_italicarea_open'    , '<fulltext', '/\{ \/\/ \}/', "<div style='font-style: italic;'>");
	Markup ('txt2tags_french_italicarea_close'    , '<fulltext', '/\{\/\/\/ \}/', "</div>");

	# bold area { ** }  
	Markup ('txt2tags_french_boldarea_open'    , '<fulltext', '/\{ \*\* \}/', "<div style='font-weight: bold;'>");
	Markup ('txt2tags_french_boldarea_close'    , '<fulltext', '/\{\/\*\* \}/', "</div>");
	
	# <!> There is no special markup for underline or strike area. Besides { -- } is for decreasing text size.
	
	# lettrine
	Markup ('txt2tags_lettrine'    , 'directives','/\{\*~~~\}(.{1}?)/',"<span class=\"initial\">$1</span>");


	# ignore 4 characters surrounded by {}, for example {****}
	Markup ('textallion_ignore_unknown_rule' , '>directives', '/\{(.{4})\}/' , '');

	# ignore 3 characters surrounded by {}, for example {|1|} (columns)
	Markup ('textallion_ignore_unknown_rule2' , '>directives', '/\{(.{3})\}/' , '');
	
	# ignore index mark
	Markup ('textallion_ignore_indexrule' , '>directives', '/\{\^\}/' , '');


# Gui 

    $GUIButtons ['centering'] = array(250, "{ ~~ }", "{/~~ }", '$[Center Text]',
                                    '$GUIButtonDirUrlFmt/text_align_center.png"$[Center Text]"');



//% lettrine      	  {*~~~} or *~~~    (was in a previous release : -**-)
//% bigskip       	  {*-*-} or *-*-
//% three stars   ✵ 	  {** *}  			(was in a previous release : *** )
//% aldine leaf   ❦ 	  {-@- } 			(was in a previous release : *--* )
//% aldine leaf2  ❧ 	  {-/@-}
//% sun		    ☼ 	  {(  )}  			(was in a previous release : +++ )
//% first ¼ moon  ☽ 	  { )) }    		(was in a previous release : +-- )
//% last ¼ moon   ☾ 	  { (( }    		(was in a previous release : --+ )
//% fullmoon      ○ 	  { () }    			
//% xx DEPRECATED xx center begin        {->--}      		(was in a previous release : ((-- )
//% xx DEPRECATED xx center end          {-<--}			(was in a previous release : --)) )
//% center text begin   { ~~ }             
//% center text end     {/~~ }
//% size ++ begin       { ++ }      		
//% size ++ end         {/++ }				
//% size -- begin       { -- }      		
//% size -- end         {/-- }				
//% italic area begin   { // }      done		
//% italic area end     {/// }      done
//% bold area begin     { ** }      		
//% bold area end       {/** }   
//% page break          {/...}   
//% line break          {//..}  

//% exergue (epigraph)  {  ~~}             
//% exergue end         {/ ~~}

//% code (monospace)    {####}  or {###;}             
//% code end            {/###}  or {/##;}

//% french guillemets begin «  { "  }   or   {"   }   or  {" }    
//% french guillemets end  »   {  " }   or   {   "}   or  { "}
//% french dialog       ---

//% latex equations     { $$ } 

//% index               { ^^ } or {^}      voici une {^}pomme{^}, une {^}poire{^}, une {^}red delicious{^pomme}

//% left wrapping       [image.png]{~~~~} 
//% right wrapping      {~~~~}[image.png] 

//%% TODO
//% attention/warning   {!}
//% information         {i}
//% question            {?}
//% positive            {+}
//% negative            {-}
//%% TODO : official correction/revision marks
